<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/30
 * Time: 18:19
 */

namespace app\api\controller\v1;


use think\Request;

class Image extends AuthBase
{

    public function save(){
        $file = Request::instance()->file('file');
        // 把图片上传到指定的文件夹
        $info = $file->move('upload');

        if($info && $info->getPathname()){
            $images = config('code.site').'/'.str_replace("\\","/",$info->getPathname());
            return show(config('code.success'),'OK', $images );
        }
    }

}